//
//  Service+Worker.m
//  gskin
//
//  Created by fengyn on 15/12/14.
//  Copyright © 2015年 lexingsoft. All rights reserved.
//

#import "Service+Worker.h"

@implementation ServiceManager(Worker)
///分页获取技师列表(到店)
+ (void)getAllWorkersWithAgencyCode:(NSString *)agencyCode pageIndex:(NSUInteger)pageIndex success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString *path = @"/workerinfo/public/offline/page";
    const int countPer=20;
    NSDictionary *parameterDict=@{@"start":@(pageIndex*countPer),
                                  @"length":@(countPer),
                                  @"agencyCode":agencyCode,
                                  };
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id resultDict) {
        failure(resultDict);
    }];
}

///分页获取技师列表(上门)
+ (void)getOnlineWorkersWithPageIndex:(NSUInteger)pageIndex success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString *path = @"/workerinfo/public/online/page";
    const int countPer=20;
    NSDictionary *parameterDict=@{@"start":@(pageIndex*countPer),
                                  @"length":@(countPer),
                                  };
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id resultDict) {
        failure(resultDict);
    }];
}

///分页获取预约技师历史
+ (void)getHistoryWorkersWithPageIndex:(NSUInteger)pageIndex success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString *path = @"/workerinfo/userhistory/page";
    const int countPer=20;
    NSDictionary *parameterDict=@{@"start":@(pageIndex*countPer),
                                  @"length":@(countPer),
                                  };
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id resultDict) {
        failure(resultDict);
    }];
}

///获取技师排班信息
+ (void)getWorkScheduleWithWorkerId:(NSString *)workerId agencyCode:(NSString *)agencyCode success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString *path = [NSString stringWithFormat:@"/workerSchedule/%@",workerId];
    NSDictionary *parameterDict=nil;
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id resultDict) {
        failure(resultDict);
    }];
}
///根据WorkID获取技师信息
+ (void)getTechnicianWithWorkID:(NSString *)workId success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString * path = [NSString stringWithFormat:@"/workerinfo/%@",workId];
    NSDictionary * dic = nil;
    [NetworkClient getRequest:path parameters:dic NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id dataObject) {
        failure(dataObject);
    }];
}
///查询医生信息列表
+ (void)getDoctorInfoWithPageIndex:(NSInteger)pageIndex success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString * path = [NSString stringWithFormat:@"/publicusers/doctorinfo/page"];
    const int countPer=20;
    NSDictionary *parameterDict=@{@"start":@(pageIndex*countPer),
                                  @"length":@(countPer),
                                  @"isAudit":@"Y",
                                  @"auditStatus":@"Y"};
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id resultDict) {
        failure(resultDict);
    }];
}

///获取学生对教练的评分
+ (void)getWorkerScoreSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString * path = [NSString stringWithFormat:@"/comment/public2worker/star"];
    NSDictionary *parameterDict=nil;
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id resultDict) {
        failure(resultDict);
    }];
}

///获取学车的内容
+ (void)getStudentDriverSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString * path = [NSString stringWithFormat:@"/common/standardChoices/subject2/values/page"];
    const int countPer = 10;
    NSDictionary * parameterDict = @{@"start":@(0*countPer),
                                     @"length":@(countPer)};
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id resultDict) {
        failure(resultDict);
    }];
}
///获取学员对教练的评价
+ (void)getUserForCocahCommentWithPageIndex:(NSUInteger)pageIndex success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString * path = [NSString stringWithFormat:@"/comment/public2worker/page"];
    const int countPer = 20;
    NSDictionary * parameterDict = @{@"start":@(0*countPer),
                                     @"length":@(countPer)};
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id resultDict) {
        failure(resultDict);
    }];

}

///远程巡视设备列表
+ (void)getRemoteTourWithPageIndex:(NSUInteger)pageIndex success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString * path = [NSString stringWithFormat:@"/remoteEquipment/page"];
    const int countPer = 20;
    NSDictionary * parameterDict = @{@"start":@(0*countPer),
                                     @"length":@(countPer)};
    [NetworkClient getRequest:path parameters:parameterDict NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id resultDict) {
        failure(resultDict);
    }];

}

///数据展示设备温度
+ (void)getRemoteTourTemperatureWithSn:(NSString *)Sn Success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString * path = [NSString stringWithFormat:@"/intervaldata/realTimeData/%@",Sn];
    NSDictionary * dic = nil;
    [NetworkClient getRequest:path parameters:dic NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id dataObject) {
        failure(dataObject);
    }];
}

///设备温度参数
+ (void)getScrollerViewItemSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString * path = @"/equipmentproperty/remotecontinuous";
    NSDictionary * dic = nil;
    [NetworkClient getRequest:path parameters:dic NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id dataObject) {
        failure(dataObject);
    }];
}

///根据时间段查询设备温度
+ (void)getRemoteTourTemperatureWithDate:(NSString*)startIntervalDate endIntervalDate:(NSString*)endIntervalDate intervalType:(NSString*)intervalType intervalDate:(NSString*)intervalDate propertyCode:(NSString*)propertyCode equipmentSn:(NSString*)equipmentSn Success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    NSString * path = @"/intervaldata";
    NSDictionary * dic = @{@"intervalDate":intervalDate,
                           @"propertyCode":propertyCode,
                           @"startIntervalDate":startIntervalDate,
                           @"intervalType":intervalType,
                           @"equipmentCode":equipmentSn,
                           @"endIntervalDate":endIntervalDate
                           };
    [NetworkClient getRequest:path parameters:dic NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id dataObject) {
        failure(dataObject);
    }];
}

///获取远程巡视设备坐标
+ (void)getEquipmentCoordinatesWithSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure
{
    
    NSString * path = @"/remoteEquipment/location";
    NSDictionary * dic = nil;
    [NetworkClient getRequest:path parameters:dic NeedPrompt:YES success:^(id dataObject) {
        success(dataObject);
    } failure:^(id dataObject) {
        failure(dataObject);
    }];
}

@end

































